package model.preprocessor;

import model.BasicResult;
import model.cnf.CNF;

/**
 * Represent the result of a preprocessor execution. It provide some useful information as the status of the execution or stdin and stderr.
 * @author stephane
 *
 */
public class PreProcessorResult extends BasicResult{

	public static final String DEFAULT_DESCRIPTION = "Result of the preprocessing";
	public static final PreProcessorResultStatus DEFAULT_STATUS = PreProcessorResultStatus.OK;
	
	private PreProcessorResultStatus status = DEFAULT_STATUS;
	private CNF cnf = null;
	private String exportPath = "";
	 

	public PreProcessorResult() {
		// TODO Auto-generated constructor stub
		description = DEFAULT_DESCRIPTION;
	}
	
	public String getExportPath() {
		return exportPath;
	}

	public void setExportPath(String exportPath) {
		this.exportPath = exportPath;
	}


	public CNF getCnf() {
		return cnf;
	}

	public void setCnf(CNF cnf) {
		this.cnf = cnf;
	}

	public PreProcessorResultStatus getStatus() {
		return status;
	}

	public void setStatus(PreProcessorResultStatus status) {
		this.status = status;
	}
	

	public String toString(){
		String res = description+" : \nStatus: "+status+"\n"+"Preprocessing time: "+getPreprocTime()+"\nwith begin at : "+begin+" ; end at :"+end;
		
		if(cnf == null || cnf.getStat() == null)
			res += "\nno statistic available";
		else
			res += "\n"+cnf.getStat().toString();
		
		return res;
	}
	
	

}
